package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@TableName("sys_dept")
public class Department {
    private Integer id;
    private Integer parentId;
    private String name;
    private  Integer orderNum;//将查询出来的部门进行排序的依据
    @JsonFormat(pattern =  "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    private String createBy;//上次修改的人

//    @TableField(exist = false)
//    private String parent;//部门的父级目录

    @TableField(exist = false)
    private Department parent;//部门的父级目录
    @TableField(exist = false)
    private List<Department> children;//部门的子目录
}
